package com.yunxiao.cloud.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunxiao.cloud.web.config.DataSource;
import com.yunxiao.cloud.web.config.DataSourceEnum;
import com.yunxiao.cloud.web.entity.User;
import com.yunxiao.cloud.web.mapper.UserMapper;
import com.yunxiao.cloud.web.service.UserService;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * <p>
 * 用户者个人消费汇总表 服务实现类
 * </p>
 *
 * @author yunxiao
 * @since 2020-01-19
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    // 覆盖类上指定的数据源2
    @DataSource(DataSourceEnum.TEST2)
    @Override
    public User getById(Serializable id) {
        return super.getById(id);
    }

    // 覆盖类上指定的数据源3
    @DataSource(DataSourceEnum.TEST3)
    @Override
    public boolean save(User entity) {
        return super.save(entity);
    }
}
